package com.zcxx.cotton.base.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zcxx.cotton.base.mapper.PubPickerDeviceMapper;
import com.zcxx.cotton.base.domain.PubPickerDevice;
import com.zcxx.cotton.base.service.IPubPickerDeviceService;

/**
 * 采棉机管理Service业务层处理
 *
 * @author ruoyi
 * @date 2021-09-23
 */
@Service
public class PubPickerDeviceServiceImpl extends ServiceImpl<PubPickerDeviceMapper,PubPickerDevice> implements IPubPickerDeviceService
{
    @Autowired
    private PubPickerDeviceMapper pubPickerDeviceMapper;

    /**
     * 查询采棉机管理
     *
     * @param pickerCode 采棉机管理ID
     * @return 采棉机管理
     */
    @Override
    public PubPickerDevice selectPubPickerDeviceById(String pickerCode)
    {
        return pubPickerDeviceMapper.selectPubPickerDeviceById(pickerCode);
    }

    /**
     * 查询采棉机管理列表
     *
     * @param pubPickerDevice 采棉机管理
     * @return 采棉机管理
     */
    @Override
    public List<PubPickerDevice> selectPubPickerDeviceList(PubPickerDevice pubPickerDevice)
    {
        return pubPickerDeviceMapper.selectPubPickerDeviceList(pubPickerDevice);
    }

    /**
     * 新增采棉机管理
     *
     * @param pubPickerDevice 采棉机管理
     * @return 结果
     */
    @Override
    public int insertPubPickerDevice(PubPickerDevice pubPickerDevice)
    {
        //pubPickerDevice.setCreateTime(DateUtils.getNowDate());
        return pubPickerDeviceMapper.insertPubPickerDevice(pubPickerDevice);
    }

    /**
     * 修改采棉机管理
     *
     * @param pubPickerDevice 采棉机管理
     * @return 结果
     */
    @Override
    public int updatePubPickerDevice(PubPickerDevice pubPickerDevice)
    {
        //pubPickerDevice.setUpdateTime(DateUtils.getNowDate());
        return pubPickerDeviceMapper.updatePubPickerDevice(pubPickerDevice);
    }

    /**
     * 删除采棉机管理对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deletePubPickerDeviceByIds(String ids)
    {
        return pubPickerDeviceMapper.deletePubPickerDeviceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除采棉机管理信息
     *
     * @param pickerCode 采棉机管理ID
     * @return 结果
     */
    @Override
    public int deletePubPickerDeviceById(String pickerCode)
    {
        return pubPickerDeviceMapper.deletePubPickerDeviceById(pickerCode);
    }

    /**
     * 查询采棉机数量
     *
     * @param pubPickerDevice 采棉机管理
     * @return 采棉机管理集合
     */
    @Override
    public int selectPubPickerDeviceCount(PubPickerDevice pubPickerDevice){
        return pubPickerDeviceMapper.selectPubPickerDeviceCount(pubPickerDevice);
    }

    /**
     * 查询采棉机数量
     *
     * @param pubPickerDevice 采棉机管理
     * @return 采棉机管理集合
     */
    @Override
    public int selectPickerCount(PubPickerDevice pubPickerDevice){
        return pubPickerDeviceMapper.selectPickerCount(pubPickerDevice);
    }

    /**
     * 状态修改
     *
     * @param pubPickerDevice 信息
     * @return 结果
     */
    @Override
    public int changeStatus(PubPickerDevice pubPickerDevice)
    {
        return pubPickerDeviceMapper.updatePubPickerDevice(pubPickerDevice);
    }
    /**
     * 查询采棉机管理列表
     *
     * @param pubPickerDevice 采棉机管理
     * @return 采棉机管理集合
     */
    @Override
    public List<PubPickerDevice> queryList(PubPickerDevice pubPickerDevice)
    {
        return pubPickerDeviceMapper.queryList(pubPickerDevice);
    }
}
